package org.liquidByte.simpleChat.communication;

import java.io.Serializable;

public abstract class ChannelData implements Serializable {
	private static final long serialVersionUID = 4071579921299113816L;
	private long identifier;
	
	protected ChannelData(long identifier) {
		this.identifier = identifier;
	}
	
	public abstract Type getType();
	public long getIdentifier() {
		return identifier;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + (int) (identifier ^ (identifier >>> 32));
		return result;
	}
	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		ChannelData other = (ChannelData) obj;
		if (identifier != other.identifier)
			return false;
		return true;
	}
	
	public enum Type {
		CALL,
		RESPONSE
	}
}
